#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Created by master on 2017/2/25


# 一个参数

def show(arg):
    print(arg)


# 两个参数
def show1(arg1, arg2):
    print(arg1, arg2)


# 默认参数 必须放在最后
def defaultShow(arg1, arg2=999):
    print(arg1, arg2)


defaultShow("aaa")
defaultShow("aaa", "bbb")
defaultShow("aaa", 888)


# 指定参数
def show2(arg1, arg2):
    print(arg1, arg2)


show2(arg2=123, arg1=999)


# 动态参数
# 参数转成元组
def show3(*arg):
    print(arg, type(arg))


show3(1)
show3(1, 22, 33, 44, 55)


# 会把参数转换成字典
def show4(**arg):
    print(arg, type(arg))


show4(n1=23)
show4(n1=23, uu=13, bb=999)


# 把单个参数放进元组 把键值对放进字典
def show5(*args, **kwargs):
    print(args, type(args))
    print(kwargs, type(kwargs))


# show5(11, 22, 33, 44, n1=88, alex="sb")

l = [11, 22, 33, 44, ]
d = {"n1": 88, "alex": "sb"}
# 会把l和d当成两个元素放进元组，字典里面没有值
show5(l, d)
# 必须这样做才能达到和之前的效果
show5(*l, **d)
